package com.dty.system.controller;

import com.dty.common.result.R;
import com.dty.model.base.ClickComment;
import com.dty.system.service.ClickCommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "评论控制层")
@RestController
@RequestMapping("clickComment")
public class ClickCommentController {

    @Autowired
    private ClickCommentService clickCommentService;
    

    @ApiOperation(value = "新增评论")
    @PostMapping("addClickComment")
    public R addClickComment(ClickComment clickComment){
            clickCommentService.addClickComment(clickComment);
        return R.ok();
    }

    @ApiOperation(value = "查询评论")
    @PostMapping("selectClickComment")
    public  R selectClickComment(Integer columnId){
       List<ClickComment> list= clickCommentService.selectClickComment(columnId);
       return R.ok(list);
    }
    @ApiOperation(value = "删除评论")
    @PostMapping("deleteClickComment")
    public  R deleteClickComment(Integer id){
        clickCommentService.deleteClickComment(id);
        return R.ok();
    }



}
